//
//  VideoRecordView.h
//  AnotherMediaTool
//
//  Created by fh on 2018/9/10.
//  Copyright © 2018年 fh. All rights reserved.
//

#import "GAKKIBaseView.h"
#import "CaptureButton.h"

/**
 闪光灯模式
 
 - PictureTakeViewFlashModeOff: 闪光灯关
 - PictureTakeViewFlashModeAuto: 闪光灯自动
 - PictureTakeViewFlashModeOn: 闪光灯开
 */
typedef NS_ENUM(NSInteger, VideoRecordViewFlashMode) {
    VideoRecordViewFlashModeOff = 0,
    VideoRecordViewFlashModeAuto = 1,
    VideoRecordViewFlashModeOn = 2
};

@interface VideoRecordView : GAKKIBaseView

/** 采集view */
@property (nonatomic, strong) UIView *preview;
/** 录制时间标签 */
@property (nonatomic, strong) UILabel *recordTimeLabel;

/** 录制事件回调 */
@property (nonatomic, copy) void(^videoRecordButtonClickedBlock)(BOOL recordingStatus,CaptureButton *button);
/** 返回事件回调 */
@property (nonatomic, copy) void(^backButtonClickedBlock)(UIButton *button);
/** 切换摄像头事件回调 */
@property (nonatomic, copy) void(^toggleButtonClickedBlock)(UIButton *button);
/** 确定选择事件回调 */
@property (nonatomic, copy) void(^sureButtonClickedBlock)(UIButton *button, NSURL *videoURL, UIImage *videoImage);
/** 重拍事件回调 */
@property (nonatomic, copy) void(^cancleButtonClickedBlock)(UIButton *button);
/** 闪光灯事件回调 */
@property (nonatomic, copy) void(^flashButtonClickedBlock)(UIButton *button, VideoRecordViewFlashMode flashMode);
/** 聚焦事件回调 */
@property (nonatomic, copy) void(^focusPreviewClickedBlock)(UITapGestureRecognizer *tapGestureRecognizer, CGPoint point);


/** 最小变焦值 */
@property (nonatomic, assign) CGFloat minScaleAndCropFactor;
/** 最大变焦值 */
@property (nonatomic, assign) CGFloat maxScaleAndCropFactor;

/** AVCaptureDevice方式变焦回调 */
@property (nonatomic, copy) void(^deviceZoomBlock)(CGFloat percentScale);

/**
 配置录制中的UI布局
 */
- (void)configurateRecordingView;

/**
 配置准备录制的UI布局
 */
- (void)configuratePrepareView;

/**
 视频预览

 @param videoURL 视频链接
 @param videoImage 视频截图
 @param videoDuration 视频时长
 @param videoSize 视频大小
 */
- (void)previewVideoWithVideoURL:(NSURL *)videoURL videoImage:(UIImage *)videoImage videoDuration:(int)videoDuration videoSize:(float)videoSize;

@end
